﻿using iemtm.WeChat.Core;
using iemtm.WeChat.Core.Managers;
using Microsoft.AspNetCore.Mvc;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;

namespace iemtm.WeChat.Web.Entry.Areas.Admin.Controllers
{
    [Area("Admin")]
    [Route("/[controller]/[action]")]
    public class MaintainController : Controller
    {
        private readonly IGeneratorManager _generatorManager;
        public MaintainController(IGeneratorManager generatorManager)
        {
            _generatorManager = generatorManager;

        }
        public IActionResult Index()
        {
            return View();
        }
        /// <summary>
        /// 添加油机维修记录
        /// </summary>
        /// <returns></returns>
        public ActionResult AddGenMaintain(string dtuid)
        {
           var G= MemoryEntity.gBuffGen[dtuid];
            ViewBag.DTUID = G.DTUID;
            ViewBag.GensetNum = G.GensetNum;


            return View();
        }
        /// <summary>
        /// 采集器维修明细
        /// </summary>
        /// <returns></returns>
        public async Task<ActionResult> Detail(string RepairCode)
        {
          var  model =await _generatorManager.GetCollectorRepairAndPritureAsync(RepairCode);
            

            return View(model);
        }
    }
}
